//
//  FQMineServiceSectionController.swift
//  SwiftProject
//
//  Created by 董駸 on 2022/8/25.
//

import UIKit

class FQMineServiceSectionController: BaseListSectionController {
    var model : FQMineServiceModel!
    
    override init() {
        super.init()
        inset = UIEdgeInsets(top: 16, left: 20, bottom: 0, right: 20)
    }
    
    override func sizeForItem(at index: Int) -> CGSize {
        CGSize(width: SCREEN_WIDTH - 40, height: 128)
    }
    
    override func cellForItem(at index: Int) -> UICollectionViewCell {
        let cell = dequeueReusableCell(cellType: FQMineServiceCollectionViewCell.self, index: index)
        cell.model = model
        cell.buttonBlock = { [unowned self] tag in
            switch tag - 10 {
            case 1:
                self.viewController?.navigationController?.qmui_pushViewController(FQHelpCenterViewController(), animated: true)
            case 2:
                self.viewController?.navigationController?.qmui_pushViewController(FQSettingViewController(), animated: true)
            default:
                break
//                self.viewController?.navigationController?.qmui_pushViewController(FQBankCardViewController(), animated: true)
            }
        }
        return cell
    }
    
    override func didUpdate(to object: Any) {
        model = object as? FQMineServiceModel
    }
}
